package cn.gudian.cms.Admin
/**
 * 用户
 */
class AdminUser {
  static belongsTo = [adminRole: AdminRole]
  String userName    //登录名
  String password    //密码
  String realName    //真实姓名
  String mobile       //手机号码
  String email         //邮箱
  String arcTypeIDs     //可管理栏目ID
  int loginNum //登陆次数
  Date lastLoginTime  //上次登陆时间
  String lastLoginIP   //上次登陆IP
  static constraints = {
    userName(size: 3..15, unique: true)
    password(blank: false)
    realName()
    mobile()
    email()
    arcTypeIDs()
    loginNum() //登陆次数
    lastLoginTime()
    lastLoginIP()   //上次登陆IP
  }


  String toString() {
    "${this.userName}"
  }
   static mapping = {
     sort id:"desc"
   }
}
